using System.Data;
using ET;
namespace DAL
{
    public class National_DAL
    {
        private static readonly clsConnect cls = new clsConnect();

        #region Getdata
        public DataTable BindGirdNational(string keywords)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@KeyWords", keywords);
            return cls.GetData("sp_tb_National_Search");
        }
        public DataTable BindGirdNationalDetail(int id)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@National_ID", id);
            return cls.GetData("sp_tb_National_Detail");
        }
        #endregion

        #region Insert
        public bool InsertNational(National_ET data)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@National_Alias", data.National_Alias);
            cls.AddParameter("@National_Name", data.National_Name);
            cls.AddParameter("@National_Note", data.National_Note);
            return cls.ExecuteNonQuery("sp_tb_National_Insert");
        }
        #endregion

        #region Update
        public bool UpdateNational(National_ET data)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@National_Id", data.National_Id);
            cls.AddParameter("@National_Alias", data.National_Alias);
            cls.AddParameter("@National_Name", data.National_Name);
            cls.AddParameter("@National_Note", data.National_Note);
            return cls.ExecuteNonQuery("sp_tb_National_Update");
        }
        #endregion

        #region Delete
        public bool DeleteNational(int id)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@National_Id", id);
            cls.ExecuteNonQuery("sp_tb_National_Delete");
            return true;
        }
        #endregion
    }
}